//app.js
  // 甲方的 wxa205a696125cb097
  	// 自己的 wxb50d5d1829a90373


App({
  Imges: require("./utils/imagUrl.js").img,
  ajax: require("./utils/request.js"),
  util: require("./utils/util.js").util,
  Api: require("./utils/api.js").Api,
  prompts: function(val){
    wx.showToast({
      title: val,
      icon: 'none',
      duration: 10000
    })
    setTimeout(function(){
      wx.hideToast()
    },1000)
  },
  //更新用户信息
  UserInfo(ck) {
    this.ajax('mp/user/info', 'GET', {}).then(res => {
      console.log(res)
      wx.setStorage({
        key: "userInfo",
        data: res.data
      });
      ck && ck(res.data);
    }).catch(err => {
      console.log('报错了', err)
    })
  },
  onLaunch: function () {
    // 获取高度
    let sys = wx.getSystemInfoSync();
    let topBotton = wx.getMenuButtonBoundingClientRect();
    this.globalData.sysHeight = sys.statusBarHeight;
    this.globalData.height = Number(topBotton.height) + (topBotton.top - topBotton.height);
    console.log('信息', topBotton, sys)
    

    // 展示本地存储能力
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
  },
  globalData: {
    userInfo: null,
    height: 0,
    sysHeight: 0
  }
})